package com.ia2014.tp.portal2.entities;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Transient;

import com.ia2014.tp.portal2.entities.Articulo;
import com.ia2014.tp.portal2.vo.ArticuloInfantilVO;
import com.ia2014.tp.portal2.vo.ArticuloVO;

@Entity
@DiscriminatorValue(value = "Infantil")
public class ArticuloInfantil extends Articulo{
	
	private String edadRecomendada;
	

	public String getEdadRecomendada() {
		return edadRecomendada;
	}

	public void setEdadRecomendada(String edadRecomendada) {
		this.edadRecomendada = edadRecomendada;
	}

	@Transient
	@Override
	public ArticuloInfantilVO getVO() {
		ArticuloInfantilVO articuloInfantilVO = (ArticuloInfantilVO) super.getVO();		
		articuloInfantilVO.setEdadRecomendada(edadRecomendada);
		return articuloInfantilVO;
	}

	@Transient
	public void setVO(ArticuloVO vo) {
		ArticuloInfantilVO articuloInfantilVO = vo.getArticuloInfantilVO();
		super.setVO(articuloInfantilVO);
		this.setEdadRecomendada(articuloInfantilVO.getEdadRecomendada());
		
	}

	@Transient
	@Override
	protected ArticuloInfantilVO getVOInstance() {
		return new ArticuloInfantilVO();
	}

	@Transient
	@Override
	public boolean isArticuloElectrodomestico() {
		// TODO Auto-generated method stub
		return false;
	}

	@Transient
	@Override
	public boolean isArticuloInfantil() {
		// TODO Auto-generated method stub
		return true;
	}

	@Transient
	@Override
	public boolean isArticuloModa() {
		// TODO Auto-generated method stub
		return false;
	}

	@Transient
	@Override
	public boolean isArticuloMueble() {
		// TODO Auto-generated method stub
		return false;
	}

	@Transient
	@Override
	public String getCategoria() {
		// TODO Auto-generated method stub
		return "infantil";
	}
}
